<?php

class Vlib_IO_File {
    
    /**
     * Get all the sub-directory of a parent derectory
     */
    public static function getDirs($parentDirectory) {
        if (!$parentDirectory || !file_exists($parentDirectory)) return array();
        $subDirectory = array();
        $directoryIterator = new DirectoryIterator($parentDirectory);
        foreach ($directoryIterator as $directory) {
            if ($directory->isDot() || !$directory->isDir()) {
                continue;
            }
            $directory = $directory->getFilename();
            if ($directory == '.svn') {
                continue;
            }
            $subDirectory[] = $directory;
        }
        return $subDirectory;
    }
    
}